package com.prs.crm.service.oa.impl;

import java.io.File;
import java.util.Collection;

import com.prs.crm.context.Attach;
import com.prs.crm.context.Constrains;
import com.prs.crm.context.FileUtil;
import com.prs.crm.context.ToolKits;
import com.prs.crm.dao.oa.RegulationDao;
import com.prs.crm.domain.oa.Regulation;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.oa.RegulationService;

public class RegulationServiceImpl extends BaseServiceImpl<Regulation,RegulationDao> implements RegulationService{

	@Override
	public void saveRegulation(Regulation regulation, File file, String fileName) {
		// TODO Auto-generated method stub
		regulation.setAttach(FileUtil.getInstance().createAttach(file, fileName));
		this.getDao().save(regulation);
	}

	@Override
	public Collection<Regulation> getAllRegulation() {
		// TODO Auto-generated method stub
		return this.getDao().getAllRegulation();
	}

	@Override
	public Collection<Regulation> getRegulationByIds(Integer[] ids) {
		// TODO Auto-generated method stub		
		return this.getDao().getRegulationByIds(ToolKits.convertToIntAry(ids));
	}

	@Override
	public Collection<Regulation> getRegulationByUserCount(int pageCount) {
		// TODO Auto-generated method stub
		return this.getDao().getRegulationByUserCount(pageCount);
	}

}
